<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
	String ctx = request.getContextPath();
%>

<html>
	<head>
		<title>数据字典管理页面</title>
		<jsp:include page="/pages/common/include.jsp"></jsp:include>
		<style type="text/css">
			*.* {
				font-size: 12px;
				overflow-x: hidden;
			}
		</style>
		<script type="text/javascript">
			$(document).ready(function() {
				$("#qryBtn").click(function() {
					$("#qryForm").children("input[name='pageNum']").val("1");
					$("#qryForm").submit();
				});
				$("#addBtn").click(function() {
					$("#addDiv").dialog("open");
					$("#addForm").form("clear");
				});

				// 初始化查询功能
				initQry("qryForm", "qryResultDiv", "qryResultTbl");
				// 创建新增弹出层
				crtAddDialog("addDiv", "addForm", function() {$("#qryBtn").trigger("click");});
				// 创建修改弹出层
				crtEditDialog("editDiv", "editForm", function() {$("#qryBtn").trigger("click");});
			});
		</script>
	</head>

	<body>
		<div id="qryDiv">
			<form id="qryForm" method="post" action="<%=ctx %>/system/dataDic!qry.do">
				<input type="hidden" name="pageNum" value="1" />
				<input type="hidden" name="pageSize" value="10" />
				<table style="font-size: 12px; padding: 0; margin: 0;">
					<tr>
						<td>数据字典类型:</td>
						<td>
							<select class="easyui-combobox" name="_QRY_dataTp">
								<option value=""
									<s:if test="%{qryParamMap['dataTp'] == ''}">
										selected="selected"
									</s:if>
								>--请选择--</option>
								<option value="EDUCATIONAL"
									<s:if test="%{qryParamMap['dataTp'] == 'EDUCATIONAL'}">
										selected="selected"
									</s:if>
								>EDUCATIONAL</option>
								<option value="POSITION"
									<s:if test="%{qryParamMap['dataTp'] == 'POSITION'}">
										selected="selected"
									</s:if>
								>POSITION</option>
							</select>
						</td>
						<td>数据字典KEY:</td>
						<td><input class="easyui-validatebox" type="text" name="_QRY_dataKey" value="<s:property value="qryParamMap['dataKey']" />"></td>
					</tr>
				</table>
			</form>
			
			<div>
				<a id="qryBtn" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
				<a id="addBtn" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add'">新增</a> 
			</div>
		</div>
		
		<div style="margin: 10px 0;">
			<div id="qryResultDiv">
				<table id="qryResultTbl"></table>
				<div id="opBtns" style="margin: 3px 0;">
					<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit'"
						onclick="editItem('qryResultTbl');">修改</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove'"
						onclick="delItem('qryResultTbl')">删除</a>
				</div>
			</div>
		</div>
		
		<div id="addDiv" title="新增数据字典">
			<form id="addForm" method="post" action="<%=ctx %>/system/dataDic!add.do">
				<table style="font-size: 12px; padding: 0; margin: 0;">
					<tr>
						<td>数据字典类型:</td>
						<td>
							<select class="easyui-combobox" data-options="required:true, missingMessage:'数据字典必输'" name="dataDic.dataTp">
								<option value="EDUCATIONAL">EDUCATIONAL</option>
								<option value="POSITION">POSITION</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>数据字典KEY:</td>
						<td>
							<input class="easyui-validatebox" data-options="required:true" type="text" name="dataDic.dataKey" />
						</td>
					</tr>
					<tr>
						<td>数据字典值:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="dataDic.dataVal" />
						</td>
					</tr>
					<tr>
						<td>数据字典顺序:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="dataDic.sortIndex" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		
		<div id="editDiv" title="修改数据字典信息">
			<form id="editForm" method="post" action="<%=ctx %>/system/dataDic!update.do">
				<table style="font-size: 12px; padding: 0; margin: 0;">
					<tr>
						<td>数据字典类型:</td>
						<td>
							<select class="easyui-combobox" name="dataTp">
								<option value="EDUCATIONAL">EDUCATIONAL</option>
								<option value="POSITION">POSITION</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>数据字典KEY:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="dataKey" />
						</td>
					</tr>
					<tr>
						<td>数据字典值:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="dataVal" />
						</td>
					</tr>
					<tr>
						<td>数据字典顺序:</td>
						<td>
							<input class="easyui-validatebox" type="text" name="_UPDATE_sortIndex" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		
		<div id="deleteDiv">
			<form id="deleteForm" method="post" action="<%=ctx %>/system/dataDic!delete.do">
				<input type="hidden" name="dataDicKey.dataTp" />
				<input type="hidden" name="dataDicKey.dataKey" />
			</form>
		</div>
	</body>
</html>